<?php
//setcookie("name", "zhangsan", time() + 30);
//setcookie("age", "20", time() + 30);
//setcookie("sex", "男", time() + 30);
//将数组转码json字符串
//$arr = ["name"=>"张三","age"=>20,"sex"=>"男"];
//$str  = json_encode($arr);
//setcookie("obj",$str,time()+3600);
//读取客户端cookie解码json字符串
//$obj = json_decode($_COOKIE["obj"]);
//echo $obj -> name;
//echo $obj -> age;


//session
session_start();
$_SESSION["name"] = "张三";
?>